<template>
  <div class="main-box container">
    <!-- 顶部导航栏 -->
    <van-nav-bar>
      <div slot="left" class="logo"></div>
      <van-button slot="right" round class="search" icon="search" type="primary" size="small" @click="$router.push('/search')">搜索</van-button>
    </van-nav-bar>
    <!-- 路由部分 -->
    <router-view></router-view>
    <!-- 底部标签栏 -->
    <van-tabbar route>
      <van-tabbar-item to="/" icon="home-o">首页</van-tabbar-item>
      <van-tabbar-item to="/question" icon="chat-o">问答</van-tabbar-item>
      <van-tabbar-item to="/video" icon="video-o">视频</van-tabbar-item>
      <van-tabbar-item to="/user" v-if="$store.state.token" icon="user-o">我的</van-tabbar-item>
      <van-tabbar-item to="/login" v-else icon="user-o">未登录</van-tabbar-item>
    </van-tabbar>
  </div>
</template>
<script>
export default {
  name: 'Layout',
  data () {
    return {

    }
  }
}
</script>
<style scoped lang='less'>
.search {
  background-color: #5babfb;
width: 100px;
}
</style>
